package homework.employee;
import homework.polymorphic.Circle;
import homework.polymorphic.Rectangle;

import java.util.Scanner;

public class TestEmployee {
    public static void main(String[] args) {
        Employee[] employees = {

        };

        double totalEarning = 0.0;
        for (Employee employee : employees) {
            System.out.println(employee.getInfo());
            totalEarning += employee.earning();

            // 检查本月生日的正式工
            if ((employee instanceof SalaryEmployee || employee instanceof Manager) &&
                    ((MyDate) ((SalaryEmployee) employee).getBirthdate()).getMonth() == getCurrentMonth()) {
                System.out.println(employee.getName() + " will receive a birthday gift!");
            }
        }

        System.out.println("Total Earning: " + totalEarning);
    }

    // 从键盘输入获取当前月份
    private static int getCurrentMonth() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter the current month (1-12): ");
        int month = scanner.nextInt();
        scanner.close();
        return month;
    }
}
